import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/app/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/app/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/app/user/logout',
    method: 'post'
  })
}
export function getList(params) {
  return request({
    url: '/app/user/list',
    method: 'get',
    params
  })
}
export function getType(){
  return request({
    url: '/app/user/getType',
    method: 'get'
  })
}
export function getEcharts(params) {
  return request({
    url: '/app/user/getEcharts',
    method: 'get',
    params
  })
}
export function my(params) {
  return request({
    url: '/app/user/my',
    method: 'get',
    params
  })
}
export function getTypeEcharts(params){
  return request({
    url: '/app/user/getTypeEcharts',
    method: 'get',
    params
  })
}

export function add(data) {
  return request({
    url: '/app/user/add',
    method: 'post',
    data
  })
}
export function upload(data) {
  return request({
    url: '/app/user/upload/img',
    method: 'post',
    data
  })
}
export function update(data) {
  return request({
    url: '/app/user/update',
    method: 'post',
    data
  })
}
export function findPwd(data) {
  return request({
    url: '/app/user/findpwd',
    method: 'post',
    data
  })
}
export function updateById(data) {
  return request({
    url: '/app/user/updateById',
    method: 'post',
    data
  })
}
export function sendrcode(params) {
  return request({
    url: '/app/user/sendrcode',
    method: 'get',
    params
  })
}
